
function xml_http() {
    if (window.XMLHttpRequest) {
        xmlhttp = new XMLHttpRequest();
    }
    else {
        xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    return xmlhttp;
}

function xml_http_request(data, page) {
    var xmlhttp = xml_http();
    xmlhttp.open("POST", page, (arguments.length === 3));
    xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
    if (arguments.length === 3) {
        xmlhttp.onreadystatechange = arguments[2];
    }
    xmlhttp.send(data);
    return xmlhttp;
}
